An enterprise may store information in fields of one or more tables or databases. For example, a table might include thousands of rows, with each row being associated with a different employee. Moreover, each row might be associated with a number of fields, or columns, each storing a value. For example, a field in a table might store a telephone number for the associated employee. In some cases, it may be appropriate for one or more fields to be “linked” to another field. For example, a first field might be linked to a second field, referred to as a “source” field, such that when the second field is subsequently updated (e.g., when an employee's telephone number is changed), that update will be automatically reflected in the first field.
Consider, for example, FIG. 1 which provides an illustration 100 of a way of linking fields in tables and/or databases. In particular, a first table 110 includes a linked entry (“ID_101”) that refers to a particular source field in a second table 120 (associated with entry “ID_202”). FIG. 1 may be considered a basic or “naïve” implementation of linked fields that simply adds the identifier associated with the source value (including the name of the second table 120) in the value of linked field of the first table 110. Such an approach is similar to a typical memory reference.
Although the implementation illustrated in FIG. 1 is simple, note that each linked field in the first table 110 refers to the source field of the second table 120 using the table name, row identifier, and field name. Therefore, if any of these parameters change, the accurate reference to the source value may be lost. To avoid such a result, the system may need to examine all of the linked fields in the first table 110 and determine whether or not each field needs to be updated. Thus, the system may need to keep track of all the linked fields and associated source fields, which can impose significant overhead in many situations. Moreover, when there is a chain of links (e.g., the second table 120 points to yet another table not illustrated in FIG. 1), the system may need several Structured Query Language (“SQL”) queries to access a single field.
FIG. 2 is an illustration 200 of another way of linking fields in tables. In this example, the system implements linked fields by creating a copy of the source value in a second table 220 at every linked field value in a first table 210. This approach may require the system to track all source fields associated linked fields for any update. As a result, a huge overhead may be imposed for every update of a source field in the second table 220 (although the complexity of fetching a value of a linked field may be limited).
Accordingly, methods and mechanisms to efficiently, accurately, and/or automatically support linked fields in tables and/or databases may be provided in accordance with some embodiments described herein.